- @force_desktop_expanded_sidebar = true

- if License.feature_available?(:custom_file_templates)
  %section.settings.as-visibility-access.no-animate#js-visibility-settings{ class: ('expanded' if expanded) }
    .settings-header
      %h4.settings-title.js-settings-toggle.js-settings-toggle-trigger-only
        = _('Templates')
      = render Pajamas::ButtonComponent.new(button_options: { class: 'js-settings-toggle' }) do
        = expanded ? _('Collapse') : _('Expand')
      %p
        = _('Select a repository containing templates for common files.')
        = link_to _('What templates can I create?'), help_page_path('user/admin_area/settings/instance_template_repository.md', anchor: 'supported-file-types-and-locations'), target: '_blank', rel: 'noopener noreferrer'
    .settings-content
      = gitlab_ui_form_for @application_setting, url: templates_admin_application_settings_path, html: { class: 'fieldset-form' } do |f|
        = form_errors(@application_setting)

        .js-vue-project-select{ data: { label: _('Select a template repository'),
          input_name: 'application_setting[file_template_project_id]',
          input_id: 'application_setting[file_template_project_id]',
          order_by: 'last_activity_at',
          with_shared: true.to_s,
          selected: @application_setting.file_template_project_id } }
        %p.gl-mt-n5= s_('TemplateRepository|Create common files more quickly, and standardize their format.')
        = f.submit _('Save changes'), pajamas_button: true
